<?php
require_once('Zend/Controller/Action.php');

class Cron_CacheController extends Zend_Controller_Action 
{
    public function indexAction()
    {
        echo 'none action specific !';
        exit();
    }

    public function clearAction() 
    {
        $cache = Kbs::initCache();

        if (false !== $cache) {
            $clearAll = $this->_getParam('all', false);
            
            if ($clearAll) {
                $cache->clean(Zend_Cache::CLEANING_MODE_ALL);
                echo 'clear all !';
            } else {
                $cache->clean(Zend_Cache::CLEANING_MODE_OLD);
                echo 'clear expired !';
            }
        } else {
            echo 'no cache available !';
        }
        die();
    }

}